'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { STRING, TEXT, DATE } = Sequelize;
    
    await queryInterface.createTable('system_settings', {
      key: {
        type: STRING(100),
        primaryKey: true,
        comment: '配置键'
      },
      value: {
        type: TEXT,
        allowNull: true,
        comment: '配置值'
      },
      created_at: {
        type: DATE,
        allowNull: false,
        defaultValue: Sequelize.NOW
      },
      updated_at: {
        type: DATE,
        allowNull: false,
        defaultValue: Sequelize.NOW
      }
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('system_settings');
  }
};